/*
 * @Author: duapple
 * @Date: 2021-10-19 17:37:10
 * @LastEditTime: 2021-10-19 21:14:07
 * @LastEditors: duapple
 * @Description: Add description
 * @FilePath: \uart_dfu\include\user_cmd.h
 * Copyright (c) 2011 duapple - All rights reserved.
 */
//#define __HJ_USER_CMD_H__
#ifndef __HJ_USER_CMD_H__
#define __HJ_USER_CMD_H__

#include "sl_bt_api.h"

#define NCP_TARGET
//#define NCP_HOST

#define DATA_LENGTH                256
#define NCP_VERSION                0x01

#ifdef NCP_TARGET
#define SOFTWARE_VERSION           0x02
#define HARDWARE_VERSION           0x01
#endif

#define USER_CMD_GET_DEV_INFO      0X01

typedef struct {
    uint16_t ncp_ver;
    uint16_t software_ver;
    uint16_t hardware_ver;
    uint8_t reserve[2];
} dev_info_t;

typedef struct {
    uint16_t id;
    union {
        uint8_t bytes[DATA_LENGTH];
    } data;
}user_cmd_t;

typedef struct {
    uint16_t id;
    union {
        dev_info_t dev_info;
        uint8_t bytes[DATA_LENGTH];
    } data;
} user_cmd_resp_t;

#ifdef NCP_HOST
/**
 * @description: 获取ncp target的版本信息
 * @param {dev_info_t} *devInfo
 * @return {*}
 */
int get_ncp_target_dev_info(dev_info_t *devInfo);
#endif

#endif /* __HJ_USER_CMD_H__ */
